package com.ucampus.service;

import com.ucampus.dao.ManagerDao;
import com.ucampus.entity.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ManagerService {
    @Autowired
    private ManagerDao managerDao;

    public ResponseData update(String username, String nickname,String password) {
        ResponseData responseData = new ResponseData();
        int n=managerDao.update(username,nickname,password);
        if(n>0){
            responseData.setMessage("修改成功，请重新登录");
            responseData.setData(managerDao.select(username));
        }else {
            responseData.setMessage("修改失败，请重试");
        }
        return responseData;
    }

}
